//
//  BMPhotoIO_iOS8Tool.h
//  bigmama
//
//  Created by huyuchen on 2017/9/28.
//  Copyright © 2017年 盛成文化. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <Photos/Photos.h>
#import "BMPhotoIOPhotoModel.h"
#import "BMPhotoIOAlbumModel.h"
#import "BMPhotoIOVideoModel.h"

@interface BMPhotoIO_iOS8Tool : NSObject

/** 上传最大容量，单位为MB, 默认为5MB*/
@property (nonatomic, assign) CGFloat maxMB;

/**
 *  查询所有相册
 *
 *  @param finishBlock             读取完毕调用block，object为 BMPhotoIOAlbumModel 相册类型对象
 */
- (void)selectAlbumWithFinishBlock:(void (^)(id obj))finishBlock videoBlock:(void (^)(id obj))videoBlock;

/**
 *  根据相册查询图片
 *
 *  @param collection              相册
 *  @param finishBlock             读取完毕调用block，object为 BMPhotoIOPhotoModel 照片类型对象
 */
- (void)selectPhotosWithCollection:(PHAssetCollection *)collection finishBlcok:(void (^)(id obj1,id obj2))finishBlock;


/**
 根据相册获取视频
 
 @param collection 视频
 @param finishBlock 读取完毕调用block，object为 BMPhotoIOPhotoModel 照片类型对象
 */
- (void)selectVideosWithCollection:(PHAssetCollection *)collection finishBlock:(void (^)(id obj1,id obj2))finishBlock;

/**
 *  根据asset获取缩略图
 *
 *  @param asset                   PHAsset图片对象
 */
- (void)thumbImageWithAsset:(PHAsset *)asset finishBlock:(void (^)(id obj))finishBLock;

/**
 根据asset获取要缓存的图片，比缩略图大，比原图小，不模糊
 
 @param asset PHAsset图片对象
 */
- (void)cacheImageWithAsset:(PHAsset *)asset finishBlock:(void (^)(id obj))finishBLock;

/**
 *  根据asset获取原图
 *
 *  @param asset                   PHAsset图片对象
 */
- (void)originalImageDataWithAsset:(PHAsset *)asset finishBlock:(void (^)(id obj))finishBLock;

/**
 获取原图
 
 @param asset PHAsset图片对象
 */
- (void)originalImageWithAsset:(PHAsset *)asset finishBlock:(void (^)(id obj))finishBLock;

/**
 根据图片id获取PHAsset对象
 
 @param ID 图片唯一id
 @return PHAsset对象
 */
- (PHAsset *)getAssetWithID:(NSString *)ID;


- (void)getVideoWithCollection:(PHAssetCollection *)collection imageBlock:(void (^)(UIImage *image))imageBlock countBlock:(void(^)(NSInteger count))countBlock;

@end
